import asyncComponent from "../component/AsyncComponent";
const Home = asyncComponent(() => import("../views/Home"));
const Statistics = asyncComponent(() => import("../views/Home/Statistics"));
const Student = asyncComponent(() => import("../views/Student"));
const School = asyncComponent(() => import("../views/Student/School"));
const Point = asyncComponent(() => import("../views/Student/Point"));
const Score = asyncComponent(() => import("../views/Student/Score"));
const Expense = asyncComponent(() => import("../views/Student/Expense"));
const Attendance = asyncComponent(() => import("../views/Student/Attendance"));
const Graduate = asyncComponent(() => import("../views/Student/Graduate"));
const Dormitory = asyncComponent(() => import("../views/Dormitory"));
const DormitoryManger = asyncComponent(
  () => import("../views/Dormitory/DormitoryManger")
);
const dormitory=asyncComponent(()=>import('../views/Dormitory/DormitoryManger/dormitory'));
const Grade = asyncComponent(() => import("../views/Grade"));
const upGrade = asyncComponent(() => import("../views/Grade/upGrade"));
const GradeManger = asyncComponent(() => import("../views/Grade/GradeManger"));
const ClassRoom = asyncComponent(() => import("../views/Grade/ClassRoom"));
const Administrator = asyncComponent(() => import("../views/Administrator"));
const Privilege = asyncComponent(
  () => import("../views/Administrator/Privilege")
);
const College = asyncComponent(() => import("../views/Administrator/College"));
const Employee = asyncComponent(
  () => import("../views/Administrator/Employee")
);
const System = asyncComponent(() => import("../views/Administrator/System"));
const Login = asyncComponent(() => import("../views/Login"));
const Marketing = asyncComponent(() => import("../views/Marketing"));
const Educational = asyncComponent(() => import("../views/Educational"));
const Finance = asyncComponent(() => import("../views/Finance"));

const DetailSdormitory = asyncComponent(() => import("../component/DetailSdormitory"));
const router = [
  {
    path: "/Home",
    title: "首页",
    nowIndex: 1,
    parent: true,
    component: Home, //首页
    children: [
      {
        path: "/Home/Statistics",
        title: "数据统计",
        nowIndex: 1,
        key: "1",
        parent: true,
        component: Statistics,
      },
      {
        from: "/Home",
        to: "/Home/Statistics",
      },
    ],
  },
  {
    path: "/Student",
    title: "学员管理",
    nowIndex: 2,
    parent: true,
    component: Student, //学员管理
    children: [
      {
        path: "/Student/School",
        title: "在校学员",
        nowIndex: 1,
        key: "2",
        parent: true,
        component: School,
      },
      {
        path: "/Student/Point",
        title: "积分管理",
        nowIndex: 2,
        key: "3",
        parent: true,
        component: Point,
      },
      {
        path: "/Student/Score",
        title: "成绩管理",
        nowIndex: 3,
        key: "4",
        parent: true,
        component: Score,
      },
      {
        path: "/Student/Expense",
        title: "费用管理",
        nowIndex: 4,
        key: "5",
        parent: true,
        component: Expense,
      },
      {
        path: "/Student/Attendance",
        title: "出勤管理",
        nowIndex: 5,
        key: "6",
        parent: true,
        component: Attendance,
      },
      {
        path: "/Student/Graduate",
        title: "毕业生管理",
        nowIndex: 6,
        key: "7",
        parent: true,
        component: Graduate,
      },
      {
        from: "/Student",
        to: "/Student/School",
      },
    ],
  },
  {
    path: "/Dormitory",
    title: "宿舍管理",
    nowIndex: 3,
    parent: true,
    component: Dormitory, //宿舍管理
    children: [
      {
        path: "/Dormitory/DormitoryManger",
        title: "宿舍管理",
        nowIndex: 1,
        key: "8",
        parent: true,
        component: DormitoryManger,
      },
      {
        from: "/Dormitory",
        to: "/Dormitory/DormitoryManger"
      }
    ],
  },
  {
    path: "/Grade",
    title: "班级管理",
    nowIndex: 4,
    parent: true,
    component: Grade, //班级管理
    children: [
      {
        path: "/Grade/upGrade",
        title: "升末班",
        nowIndex: 1,
        key: "9",
        parent: true,
        component: upGrade,
      },
      {
        path: "/Grade/GradeManger",
        title: "班级管理",
        nowIndex: 2,
        key: "10",
        parent: true,
        component: GradeManger,
      },
      {
        path: "/Grade/ClassRoom",
        title: "教室管理",
        nowIndex: 3,
        key: "11",
        parent: true,
        component: ClassRoom,
      },
      {
        from: "/Grade",
        to: "/Grade/upGrade"
      }
    ],
  },
  {
    path: "/Administrator",
    title: "管理员管理",
    nowIndex: 5,
    parent: true,
    component: Administrator, //管理员管理
    children: [
      {
        path: "/Administrator/College",
        title: "学院管理",
        nowIndex: 2,
        key: "13",
        parent: true,
        component: College,
      },
      {
        path: "/Administrator/Privilege",
        title: "权限管理",
        nowIndex: 1,
        key: "12",
        parent: true,
        component: Privilege,
      },

      {
        path: "/Administrator/Employee",
        title: "员工管理",
        nowIndex: 3,
        key: "14",
        parent: true,
        component: Employee,
      },
      {
        path: "/Administrator/System",
        title: "系统设置",
        nowIndex: 4,
        key: "15",
        parent: true,
        component: System,
      },
      {
        from: "/Administrator",
        to: "/Administrator/Privilege"
      }
    ],
  },
  {
    path: "/Login",
    title: "登录",
    nowIndex: 5,
    parent: false,
    component: Login,
  },
  {
    path: "/dormitory",
    title: "宿舍",
    nowIndex: 6,
    parent: false,
    component: dormitory,
  },
  {
    path: "/DetailSdormitory",
    nowIndex: 7,
    parent: false,
    component: DetailSdormitory,
  },
  
  // {
  //   from: "/",
  //   to: "/Home",
  //   nowIndex: 6,
  //   parent: false,
  // },
  {
    path: "/Marketing",
    title: "市场部",
    nowIndex: 6,
    parent: false,
    component: Marketing,
  },
  {
    path: "/Educational",
    title: "教务",
    nowIndex: 7,
    parent: false,
    component: Educational,
  },
  {
    path: "/Finance",
    title: "教务",
    nowIndex: 7,
    parent: false,
    component: Finance,
  },
  
];

export default router;
